import axios from 'axios'
import { typesUrl,shopsUrl } from '../../baseUrl/index'
let state={}

let mutations={}

let actions={
    getShopsData(context,prop){
        let params = {
            transform:1,
            order:'id,desc',
            filter:'pid,cs,'+prop.id
        }
        if(prop.page){
            params.page = '1,'+prop.page
        }
        return new Promise(function(resolve,reject){
            axios({
                url:shopsUrl,
                method:'get',
                params:params
            })
            .then(res=>{
                resolve(res.data.records)
            })
        })
    }
}

export default {
    namespaced: true,
    state,
    mutations,
    actions
}